﻿    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Windows.Data;
    using Pivotbrowser.Web;
using System.Windows;
using System.Windows.Media;

    /// <summary>
    /// Two way <see cref="IValueConverter"/> that lets you bind the inverse of a boolean property to a dependency property.
    /// </summary>
    /// 
namespace Pivotbrowser.Helpers
{
    public class RmeldungConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var str = value as string;
            if (str != null && str.StartsWith("Ja"))
                return new SolidColorBrush(Colors.Green);

            if (str != null && str.StartsWith("Ausstehend"))
                return new SolidColorBrush(Colors.Orange);

            return new SolidColorBrush(Colors.Red);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value;
        }
    }
}
